import { FieldType, FieldConfig } from './types';

// 基础字段配置
export const baseFields: FieldConfig[] = [
  {
    fieldName: '标题',
    fieldKey: 'title',
    fieldType: FieldType.TEXT,
    required: true,
    searchable: true,
    listable: true,
    sort: 1,
    placeholder: '请输入标题'
  },
  {
    fieldName: 'URL别名',
    fieldKey: 'slug',
    fieldType: FieldType.TEXT,
    required: true,
    searchable: true,
    listable: false,
    sort: 2,
    placeholder: '请输入URL别名'
  },
  {
    fieldName: '所属分类',
    fieldKey: 'categoryId',
    fieldType: 'select',
    required: true,
    searchable: true,
    listable: true,
    sort: 3,
    placeholder: '请选择分类',
    render: 'CategoryRender'
  },
  {
    fieldName: '标签',
    fieldKey: 'tags',
    fieldType: FieldType.TEXT,
    required: false,
    searchable: true,
    listable: false,
    sort: 4,
    placeholder: '请输入标签，多个用逗号分隔'
  },
  {
    fieldName: '缩略图',
    fieldKey: 'thumbnail',
    fieldType: 'image',
    required: false,
    searchable: false,
    listable: true,
    sort: 5,
    placeholder: '请上传缩略图',
    width: 100,
    render: 'ImageRender'
  },
  {
    fieldName: '摘要',
    fieldKey: 'summary',
    fieldType: FieldType.TEXTAREA,
    required: true,
    searchable: true,
    listable: false,
    sort: 6,
    placeholder: '请输入摘要'
  }
];

// 发布信息字段
export const publishFields: FieldConfig[] = [
  {
    fieldName: '作者',
    fieldKey: 'author',
    fieldType: FieldType.TEXT,
    required: false,
    searchable: true,
    listable: true,
    sort: 1,
    placeholder: '请输入作者'
  },
  {
    fieldName: '发布时间',
    fieldKey: 'publishTime',
    fieldType: 'datetime',
    required: false,
    searchable: true,
    listable: true,
    sort: 2,
    placeholder: '请选择发布时间',
    width: 180,
    render: 'DateTimeRender'
  },
  {
    fieldName: '状态',
    fieldKey: 'status',
    fieldType: 'select',
    required: true,
    searchable: true,
    listable: true,
    sort: 3,
    placeholder: '请选择状态',
    options: 'cms_article_status'
  },
  {
    fieldName: '推荐类型',
    fieldKey: 'isTop',
    fieldType: 'select',
    required: false,
    searchable: true,
    listable: true,
    sort: 4,
    placeholder: '请选择推荐类型',
    width: 100,
    render: 'TopTypeRender',
    options: [
      { label: '普通', value: '0' },
      { label: '置顶', value: '1' },
      { label: '推荐', value: '2' },
      { label: '置顶且推荐', value: '3' }
    ]
  }
];

// SEO字段
export const seoFields: FieldConfig[] = [
  {
    fieldName: 'SEO标题',
    fieldKey: 'seoTitle',
    fieldType: FieldType.TEXT,
    required: false,
    searchable: false,
    listable: false,
    sort: 1,
    placeholder: '请输入SEO标题'
  },
  {
    fieldName: 'SEO关键词',
    fieldKey: 'seoKeywords',
    fieldType: FieldType.TEXT,
    required: false,
    searchable: false,
    listable: false,
    sort: 2,
    placeholder: '请输入SEO关键词'
  },
  {
    fieldName: 'SEO描述',
    fieldKey: 'seoDescription',
    fieldType: FieldType.TEXTAREA,
    required: false,
    searchable: false,
    listable: false,
    sort: 3,
    placeholder: '请输入SEO描述'
  }
];

// 高级设置字段
export const advancedFields: FieldConfig[] = [
  {
    fieldName: '文章来源',
    fieldKey: 'source',
    fieldType: FieldType.TEXT,
    required: false,
    searchable: true,
    listable: false,
    sort: 1,
    placeholder: '请输入文章来源'
  },
  {
    fieldName: '来源链接',
    fieldKey: 'sourceUrl',
    fieldType: FieldType.TEXT,
    required: false,
    searchable: false,
    listable: false,
    sort: 2,
    placeholder: '请输入来源链接'
  },
  {
    fieldName: '允许评论',
    fieldKey: 'allowComment',
    fieldType: 'radio',
    required: false,
    searchable: false,
    listable: false,
    sort: 3,
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 }
    ]
  },
  {
    fieldName: '排序号',
    fieldKey: 'sort',
    fieldType: 'number',
    required: false,
    searchable: false,
    listable: false,
    sort: 4,
    defaultValue: 0
  }
];

// 附件字段
export const attachmentFields: FieldConfig[] = [
  {
    fieldName: '文章图片集',
    fieldKey: 'images',
    fieldType: 'gallery',
    required: false,
    searchable: false,
    listable: false,
    sort: 1,
    placeholder: '请上传图片'
  },
  {
    fieldName: '下载附件',
    fieldKey: 'downloads',
    fieldType: 'file',
    required: false,
    searchable: false,
    listable: false,
    sort: 2,
    placeholder: '请上传附件'
  }
]; 